package com.jk.lesson3;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

/**
 * Created by Auser on 2016/11/9.
 */
public class ConsumerTest {
    public static <T> void forEach(List<T> list, Consumer<T> consumer){
        for(T i : list)
            consumer.accept(i);

    }

    public static void main(String...args){
        forEach(Arrays.asList(5,4,3,2,1,0), (Integer integer) -> System.out.println(integer));
    }

}
